import { createSlice } from '@reduxjs/toolkit'

const initialState = {
  collapsed: false
}

export const basicSlice = createSlice({
  name: 'basic',
  initialState,
  reducers: {
    setCollapsed: (state) => {
      state.collapsed  = !state.collapsed
    },
    closeCollapsed (state) {
      state.collapsed  = true
    },
    openCollapsed(state) {
      state.collapsed  = false
    },
  },
})

// Action creators are generated for each case reducer function
export const { setCollapsed, closeCollapsed, openCollapsed } = basicSlice.actions

export default basicSlice.reducer